package com.shop.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MyRedissonConfig {

    @Bean
    public RedissonClient redisson(){
           //1、创建配置
        Config config=new Config();
        config.useSingleServer().setAddress("redis://39.96.73.249:6379");
        config.useSingleServer().setPassword("redis123");
        //2、根据config创建出redissonClient示例
         RedissonClient redissonClient= Redisson.create(config);
         return redissonClient;
    }

}
